package org.jeecg.modules.meter.mapper;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.entity.meter.Meter;
import org.jeecg.entity.meter.MeterAccount;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: 仪表账户表
 * @Author: jeecg-boot
 * @Date:   2020-12-01
 * @Version: V1.0
 */
public interface MeterAccountMapper extends BaseMapper<MeterAccount> {

    @SqlParser(filter = false)
    MeterAccount getByMeterId(@Param("meterId") String meterId);
    @SqlParser(filter = true)
    List<MeterAccount> queryByMeterIds(@Param("meterIds") ArrayList<String> meterIdList);
    @SqlParser(filter = true)
    void refreshRemainByRead(@Param("meterAccountList") List<MeterAccount> meterAccountList);
    @SqlParser(filter = true)
    void refreshRemain(@Param("meterAccountList")List<MeterAccount> meterAccountList);
    @SqlParser(filter = true)
    void refreshReadTimeBatch(@Param("list") List<Meter> onlyReadTimeList);


    void updateAmount(@Param("newMeterAccount") MeterAccount newMeterAccount);

    void updateRepairRead(@Param("bean") MeterAccount meterAccount);
}
